{__NOLAYOUT__}
<include file="Public/meta"/>
        
        

        <div class="container-fluid">
            <div class="row-fluid">
                    
<div class="btn-toolbar">
    <button class="btn btn-primary" id="submit"><i class="icon-save"></i> 提交</button>
    <!-- <a href="#myModal" data-toggle="modal" class="btn">删除</a> -->
  <div class="btn-group">
  </div>
</div>
<div class="well">
    
    <div id="myTabContent" class="tab-content">
      <div class="tab-pane active in" id="home">
    <form id="tab">
        <label>用户名</label>
        <input type="text" value="{$data.username}" class="input-xlarge" name="username" id="username">
        <label>昵称</label>
        <input type="text" value="{$data.nickname}" class="input-xlarge" name="nickname" id="nickname">
        <label>密码</label>
        <input type="password" value="" class="input-xlarge" name="password" id="password">
        <label>确认密码</label>
        <input type="password" value="" class="input-xlarge" name="passaff" id="passaff">
        <label>手机号码</label>
        <input type="text" value="{$data.phone}" class="input-xlarge" name="phone" id="phone">
        <label>邮箱</label>
        <input type="text" value="{$data.email}" class="input-xlarge" name="email" id="email">
        <label>性别</label>
        <input type="radio" value="0" name="gender" class="input-xlarge" <if condition='$data["gender"] eq 0'>checked</if>>男
        <div style="width: 50px;display: inline-block;"></div>
        <input type="radio" value="1" name="gender" class="input-xlarge" <if condition='$data["gender"] eq 1'>checked</if>>女
       
        <label>状态</label>
        <select name="status" id="status" class="input-xlarge">
          <option value="1" <if condition='$data["status"] eq 1'>selected</if>>正常</option>
          <option value="0" <if condition='$data["status"] eq 0'>selected</if>>冻结</option>
        </select>
    </form>
      </div>
      <div class="tab-pane fade" id="profile">
    
      </div>
  </div>

</div>

<div class="modal small hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Delete Confirmation</h3>
  </div>
  <div class="modal-body">
    
    <p class="error-text"><i class="icon-warning-sign modal-icon"></i>Are you sure you want to delete the user?</p>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
    <button class="btn btn-danger" data-dismiss="modal">Delete</button>
  </div>
</div>

<script type="text/javascript">

  function passaffblur(){
      var password = $('#password').val();
      var passaff = $('#passaff').val();
      if(password != passaff){
        layer.msg('两次密码不一致',{icon:2,time:1000});return false;
      }else{
        return true;
      }
  }


  $('#passaff').blur(function(){
      passaffblur();
  })


  $("#submit").click(function(){
      var formdata = $('#tab').serialize();
      

      
      if(passaffblur()){
        $.post("",formdata,function(data){
          if(data.code==1){
              layer.msg(data.info,{icon:1,time:1000},function(){
                 window.parent.location.reload();
              });
          }else{
              layer.msg(data.info,{icon:2,time:1000});
          }
        })
      }
      
      


  })
  
</script>